<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="../../css/weui.min.css" />
		<link rel="stylesheet" type="text/css" href="../../css/jquery-weui.min.css" />
		<link rel="stylesheet" type="text/css" href="../../css/index.css" />
		<link rel="stylesheet" type="text/css" href="../../css/mine.css" />
		<link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_546019_o8qxm6fupb0ggb9.css" />
		<title>运输车列表</title>
		<script src="../../js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/jquery-weui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/baseConfig.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div id="header">
			<div class="header-title" style="position: fixed;top: 0;">
				<!--<img src="../../img/left.png" class="left" />
				<span>运输车列表</span>-->
				<em><a href="addTransport.html">添加运输车</a></em>
			</div>
		</div>
		<div class="mine-content" style="margin-bottom: 0;">
			<!--过磅列表 -->
			<ul class="order-list">		
				<!--<li>
					<p class="first_p">
						<span>HSGFG6500234982298</span>
					</p>
					<p class="em_p">
						<span>30.12 <em>吨</em></span>
					</p>
					<p class="second_p">
						<span class="time">2017/06/28 10:35:45</span>
					</p>
					<p class="third_p">
						<span>已确认</span>
						<span>已出场</span>
					</p>
					<img src="../../img/right.png" />
				</li>-->
			</ul>
		</div>
	</body>
	<script type="text/javascript">
		$(document).ready(function(){
			baseConfig.historyBack();
			$.showLoading("加载中...");
			var fn = {};
			fn.confirm = function(num){
				if(num==0){
					return "未确认"
				}else{
					return "已确认"
				}
			}
			fn.enter = function(num2){
				if(num2==0){
					return "未入场"
				}
				if(num2==1){
					return "已入场"
				}
				if(num2==2){
					return "可出场"
				}
				if(num2==3){
					return "已出场"
				}
				if(num2==4){
					return "待入场"
				}
			}
			$.ajax({
					type: "get",
					url: baseConfig.localHttp+"weChatApi/fgclient/getTransInfoList",
					async: false,
					headers: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					data: {
						clientId: baseConfig.login(),
						orderNo:baseConfig.GetQueryString('orderNo')
//						keywords:''
					},
					success: function(data) {
						$.hideLoading();
						console.log(data)
						if(data.code==100){
							var content = data.content
							var $li=""
							for(var i=0;i<content.length;i++){
								$li +="<li carNo="+content[i].carNo+" orderNo="+content[i].orderNo+" enter="+content[i].enterStatus+"><p class='first_p'><span>"+content[i].carNo+"</span></p><p class='em_p'><span>"+content[i].weight+"<em>吨</em></span></p><p class='second_p'><span class='time'>"+content[i].uploadTime.slice(0,19)+"</span></p>"
								$li+= "<p class='third_p'><span class='confirm' confirm="+content[i].confirmEnterStatus+" style='color:"+baseConfig.colorTrans(content[i].confirmEnterStatus)+";border-color:"+baseConfig.colorTrans(content[i].confirmEnterStatus)+"'></span><span class='enter' enter="+content[i].enterStatus+" style='color:"+baseConfig.colorTrans(content[i].enterStatus)+";border-color:"+baseConfig.colorTrans(content[i].enterStatus)+"'></span></p><img src='../../img/right.png' /></li>"
							}
							$(".order-list").append($li)
							for(var j=0;j<$(".order-list li").length;j++){
									$(".order-list li").eq(j).find(".confirm").html(fn.confirm($(".order-list li").eq(j).find(".confirm").attr("confirm")))
									$(".order-list li").eq(j).find(".enter").html(fn.enter($(".order-list li").eq(j).find(".enter").attr("enter")))
									$(".order-list li").eq(j).on("click",function(){
										var a = $(this).attr("carNo");
										var b = $(this).attr("orderNo");
										var enter = $(this).attr("enter")
										if(enter==0){
											location.href = "transportInfor.html?carNo="+a+"&orderNo="+b
										}else{
											location.href = "../order/LooktransportInformation.html?carNo="+a+"&orderNo="+b
										}
									})
							}
						}else{
							$.toptip(data.content, 1200, 'error');
						}					
					},
					error:function(){
						$.hideLoading();
						$.toast("请求失败", "cancel");
					}
				})	
				//添加运输车						
			})	
	</script>
</html>